package com.ruizhong.centercontroll.service;

import com.baomidou.mybatisplus.extension.service.IService;

import com.ruizhong.centercontroll.entity.*;

import javax.websocket.EncodeException;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

public interface TCommandService extends IService<TCommand> {

    void removeCommandByMain(String mainType, Integer mainId, String commandType);

    void saveCommandList(String componentType, String commandType, HashMap<Integer, List<Map<String, Object>>> componentIdMapCommandList);

    List<TCommand> getCommandListByMain(Integer id, String type, String commandType);


    void executeSingleCommandAndGetReply(TCommand tCommand, Map<String, Object> variableMap, String wsToken,String ip);

    void executeCommandsAndGetReply(List<TCommand> commandList, Map<String, Object> variableMap, String wsToken, String ip) throws EncodeException, IOException;

    void executeCommandsAndGetReplyOfAudio(List<TCommand> commandList, Map<String, Object> variableMap, String wsToken,String ip);

    List<TCommand> fillTCommands(List<TCommand> clickCommands);

    void getCommandListByPageIdAndCommandType(Integer pageId, String commandType);

    void initPage(Map<String, Object> variableMap, List<TButton> buttonsByPageId, List<TSlider> sliderIdsByPageId, List<TVideo> videoIdsByPageId, List<TWebPage> webPageIdsByPageId, List<TSwitch> switchsByPageId, List<TImage> imagesByPageId, List<TTextView> tTextViewsByPageId, List<TPPT> pptsByPageId, String tokenId,String ip);

    void delCommandsByMain(Set<Integer> Ids, String mainType);

    void saveCommandList(List<TCommand> commandList);
}
